var aArray = new Array( 5 );


for( var i = 0; i < aArray.length; i = i + 1 )
{
	aArray[ i ] = 0;
}


function showImage( nIndex )

{
	aArray[ nIndex ] = aArray[ nIndex ] + 1;
}
		



function showMorocco()
{
	aArray[ 0 ] = aArray[ 0 ] + 1;
	document.getElementById( "picture" ).src = "images/morocco4.jpg";
	document.getElementById( "picture" ).alt = "This is a picture of a Moroccan vendor.";
	document.getElementById( "picture" ).title = "This is a picture of a Moroccan vendor.";	
	document.getElementById( "caption" ).innerHTML = "The picture on the left is a Moroccan vendor at the market.  The image on the right is the Moroccan flag.";												
	document.getElementById( "picture2").src = "images/moroccoFlag.png";
	document.getElementById( "picture2" ).alt = "This is a picture of the Moroccan Flag.";
	document.getElementById( "picture2" ).title = "This is a picture of the Moroccan Flag.";	
	
}

function showTogo()
{
	aArray[ 1 ] = aArray[ 1 ] + 1;
	document.getElementById( "picture" ).src = "images/tabermaTogo.jpg"
		document.getElementById( "picture" ).alt = "This is a picture of a house in Togo";
		document.getElementById( "picture" ).title = "This is a picture of a house in Togo";	
		document.getElementById( "caption" ).innerHTML = "The picture on the left is of a small town in the Taberma Valley, the pictured area is a UNESCO Heritage site.  The picture on the right is the flag of Togo.";
		document.getElementById( "picture2").src = "images/togoFlag.png";
		document.getElementById( "picture2" ).alt = "This is a picture of Togo's Flag.";
		document.getElementById( "picture2" ).title = "This is a picture of Togo's Flag.";	

}

function showNamibia()
{
	aArray[ 2 ] = aArray[ 2 ] + 1;
	document.getElementById( "picture" ).src = "images/namibDesert.jpg";
	document.getElementById( "picture" ).alt = "This is a picture of the Namib Desert";
	document.getElementById( "picture" ).title = "This is a picture of the Namib Desert";	
	document.getElementById( "caption" ).innerHTML = "The Namib desert has huge sand dunes, like the one pictured on the left. On the right is a picture of the flag of Namibia.";	
	document.getElementById( "picture2").src = "images/namibiaFlag.png";
	document.getElementById( "picture2" ).alt = "This is a picture of the Namibian Flag.";
	document.getElementById( "picture2" ).title = "This is a picture of the Namibian Flag.";	

}

function showLesotho()
{
	aArray[ 3 ] = aArray[ 3 ] + 1;
	document.getElementById( "picture" ).src = "images/MadagascarFamily.jpg";
	document.getElementById( "picture" ).alt = "This is a picture of family standing together outdoors.";
	document.getElementById( "picture" ).title = "TThis is a picture of family standing together outdoors.";	
	document.getElementById( "caption" ).innerHTML = "This family is posing on the side of the road in Madagascar.  The picture on the right Madagascar's flag.";
	document.getElementById( "picture2").src = "images/madagascarFlag.png";
	document.getElementById( "picture2" ).alt = "This is a picture of Madagascar's Flag.";
	document.getElementById( "picture2" ).title = "This is a picture of Madagascar's Flag.";	

}

function showMadagascar()
{
	aArray[ 4 ] = aArray[ 4 ] + 1;
	document.getElementById( "picture" ).src = "images/Lesotho_Makhaleng.jpg";
	document.getElementById( "picture" ).alt = "Makhaleng River in Lesotho";
	document.getElementById( "picture" ).title = "Makhaleng River in Lesotho";	
	document.getElementById( "caption" ).innerHTML = "This is the Makhaleng River in Lesotho.  The picture on the right is the Lesotho flag.";
	document.getElementById( "picture2").src = "images/lesothoFlag.png";
	document.getElementById( "picture2" ).alt = "This is a picture of the Lesotho Flag.";
	document.getElementById( "picture2" ).title = "This is a picture of the Lesotho Flag.";	

}

function showCounter()
{
		
	if( aArray[ 0 ] > 0 && aArray[ 1 ] > 0 && aArray[ 2 ] > 0 && aArray[ 3 ] > 0 && aArray[ 4 ] > 0 )
	{
		alert( "CONGRATULATIONS!!!  " + aArray);
		window.location = "page2.html" ;
	}			
	
	else
	{
		alert ( "You didn't finish! You must visit each country to complete the course." );
	}
}




